package com.gsezone;

public class MyStringUtils {

	public static void main(String[] args) {

		System.out.println("AAA".replace('A', 'B'));

		System.out.println("AAABBBAAA".replace("AAA", "BBB"));

		System.out.println("AAABBBAAA".replaceFirst("AAA", "BBB"));

		System.out.println("AAABBBAAA".replaceAll("A{2}", "BBB"));

		System.out.println("A|AA|AAA".replaceAll("A{2,3}", "BBB"));

		System.out.println("A|AA|AAA".replaceAll("A{2,3}?", "BBB"));

		System.out.println("A|AB|ACD".replaceAll("[A-B]", "x"));

		System.out.println("ABABBBAAAZ".replaceAll("[AB]*", "x"));

		System.out.println("ABABBBAAAZ".contains("BA"));

		System.out.println("ABABBBAAAZ".endsWith("AZ"));
		System.out.println("ABABBBAAAZ".startsWith("AB"));

		System.out.println("ABABBBAAAZ".indexOf("BA"));

		System.out.println("ABABBBAAAZ".lastIndexOf("BA"));

		System.out.println("ABABBBAAAZ".matches("[A-B]*Z"));

		System.out.println("ABABBBAAAZ".substring(1));
		System.out.println("ABABBBAAAZ".substring(1, 3));
		System.out.println(" \tABABBBAAAZ\t".trim());
		System.out.println("AbAbbbAAAZ".toUpperCase());
		System.out.println("AbAbbbAAAZ".toLowerCase());
	}

}
